import { IsStringRw } from '@/common/utils/class-validator';
import { Transform } from 'class-transformer';
import { IsIn, IsOptional } from 'class-validator';

export class CreateDictDto {
  @IsStringRw()
  dictCode: string;

  @IsStringRw()
  name: string;

  @IsStringRw()
  @IsOptional()
  remark: string;

  @Transform(({ value }) => Number(value))
  @IsIn([1, 0], { message: '状态必须是 1 或 0' })
  status: number;
}
